package com.smf.lsc.core.exception;

import java.util.Map;

/**
 * 
 * 系统自定义异常处理类,异常分为预期的异常和Runtiming异常,针对预期的异常需要在程序中抛出此类异常信息
 * @author
 *
 */
public class BaseException extends Exception{
 
	private static final long serialVersionUID = 697213883934767284L;
	private static final String DEF_ERROR_STR="未配置异常信息配置";
	private int code;
	private String message;
 
	public BaseException(int code,String message) {
		super(message);
		this.message = message;
		this.code=code;
	}
	
	public BaseException(int code) {
		this.message = ExceptionPropertiesUtil.getProperties(code+"", DEF_ERROR_STR);
		this.code=code;
	}

    public BaseException(int code, Map<String, String> map) {
        this.message = ExceptionPropertiesUtil.getProperties(code+"", map, DEF_ERROR_STR);
		this.code=code;
    }
 
	public String getMessage() {
		return message;
	}
 
	public void setMessage(String message) {
		this.message = message;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}
}